.ember-basic-dropdown {
  position: relative;
}

.ember-basic-dropdown-content {
  position: absolute;
  min-width: 160px;
  z-index: 4000;
  background: var(--content-background);
}

.ember-basic-dropdown-content--left {
  left: 0;
}
.ember-basic-dropdown-content--right {
  right: 0;
}

.ember-basic-dropdown-content-wormhole-origin {
  display: inline;
}

.ember-power-select {
  position: relative;
}

// Trigger
.ember-power-select-trigger {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: transparent;
  overflow-x: hidden;
  text-overflow: ellipsis;
  user-select: none;
  font-size: 13px;
  color: $ember-power-select-text-color;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.ember-basic-dropdown-trigger--below.ember-power-select-trigger[aria-expanded='true'],
.ember-basic-dropdown-trigger--in-place.ember-power-select-trigger[aria-expanded='true'] {
  border-bottom-left-radius: $ember-power-select-opened-border-radius;
  border-bottom-right-radius: $ember-power-select-opened-border-radius;
}

.ember-basic-dropdown-trigger--above.ember-power-select-trigger[aria-expanded='true'] {
  border-top-left-radius: $ember-power-select-opened-border-radius;
  border-top-right-radius: $ember-power-select-opened-border-radius;
}

.ember-power-select-options {
  max-height: 200px;
  overflow-y: auto;
}

.ember-power-select-selected-item {
  flex: 1 1 auto;
  margin-right: 20px;

  em {
    margin-left: 4px;
    font-weight: bold;
    font-size: 11px;
    font-style: normal;
    color: var(--color-primary);
  }
}

.ember-power-select-multiple-options
  .ember-power-select-multiple-option:first-of-type {
  span[role='button'] {
    display: none;
  }
}

.ember-power-select-multiple-options {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  list-style: none;

  & li.ember-power-select-trigger-multiple-input-container {
    flex-grow: 1;
    display: flex;

    & input {
      flex-grow: 1;
    }
  }
}

.ember-power-select-trigger-multiple-input {
  font-family: inherit;
  font-size: inherit;
  border: none;
  line-height: inherit;
  -webkit-appearance: none;
  outline: none;
  padding: 0;
  background-color: transparent;
  text-indent: 2px;
}

html[data-theme='dark'] .ember-power-select-multiple-option {
  color: var(--color-primary);
}

.ember-power-select-multiple-option {
  display: inline-block;
  background: var(--color-primary-opacity-25);
  color: var(--color-primary-darken-50);
  border-radius: var(--border-radius);

  padding: 3px 9px;
  font-size: 14px;
}

.ember-power-select-multiple-remove-btn {
  cursor: pointer;
  &:not(:hover) {
    opacity: 0.5;
  }
}

.ember-power-select-status-icon {
  position: absolute;
  right: 0;
  display: block;
  font-size: 18px;

  &:after {
    content: '›';
    position: absolute;
    bottom: -14px;
    left: -16px;
    transform: rotate(90deg);
  }

  .ember-basic-dropdown-trigger[aria-expanded='true'] & {
    &:after {
      left: -18px;
      bottom: -13px;
      transform: rotate(-90deg);
    }
  }
}

// Dropdown
.ember-power-select-dropdown {
  border-left: $ember-power-select-dropdown-left-border;
  border-right: $ember-power-select-dropdown-right-border;
  border-radius: $ember-power-select-dropdown-default-border-radius;
  box-shadow: 0 2px 5px var(--shadow-color);
  border-color: #ddd;
  color: $ember-power-select-text-color;
  font-size: 14px;
}

.ember-power-select-dropdown.ember-basic-dropdown-content--above {
  border-top: $ember-power-select-dropdown-top-border;
  border-bottom: $ember-power-select-dropdown-contiguous-border;
  border-bottom-left-radius: $ember-power-select-opened-border-radius;
  border-bottom-right-radius: $ember-power-select-opened-border-radius;
}

.ember-power-select-dropdown.ember-basic-dropdown-content--below,
.ember-power-select-dropdown.ember-basic-dropdown-content--in-place {
  border-top: $ember-power-select-dropdown-contiguous-border;
  border-bottom: $ember-power-select-dropdown-bottom-border;
  border-top-left-radius: $ember-power-select-opened-border-radius;
  border-top-right-radius: $ember-power-select-opened-border-radius;
}

.ember-power-select-dropdown.ember-basic-dropdown-content--in-place {
  width: 100%;
}

.ember-power-select-option {
  cursor: pointer;
  padding: 6px 10px;
  color: var(--color-black);

  em {
    font-size: 11px;
    font-style: normal;
    color: var(--color-black-opacity-70);
  }
}

.ember-power-select-group[aria-disabled='true'] {
  color: $ember-power-select-disabled-option-color;
  cursor: not-allowed;
}

.ember-power-select-group[aria-disabled='true'] .ember-power-select-option,
.ember-power-select-option[aria-disabled='true'] {
  color: $ember-power-select-disabled-option-color;
  pointer-events: none;
  cursor: not-allowed;
}

.ember-power-select-option[aria-selected='true'] {
  background-color: var(--content-background);
  color: var(--color-primary);
}

.ember-power-select-option[aria-current='true'] {
  background-color: var(--background-light);
}

// Disabled styles
.ember-power-select-trigger[aria-disabled='true'] {
  background-color: $ember-power-select-disabled-background-color;
  pointer-events: none;
}

.ember-power-select-search-input {
  width: 100%;
  padding: 7px;
  font-size: 14px;
  background: var(--input-background);
  color: var(--input-color);

  &:focus {
    outline: 1px solid var(--color-primary);
  }
}
